﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/site.master" AutoEventWireup="true" CodeFile="AnhQuangCao.aspx.cs" Inherits="administrator_AnhQuangCao" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
    .displaypreview{max-width: 500px; max-height: 500px;}
    </style>
        <style>
.hide{display:none;}
.table-format{border: 1px solid gray; width: 100%}
tr.th{background: url(images/bg-head-grid.gif) repeat-x; height: 26px;}
tr.even{height: 24px; background: gainsboro;}

</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

   <table>
   <tr>
    <td colspan="2"><asp:Label runat="server" ID="lblthongbao" ForeColor="red" BackColor="yellow"></asp:Label></td>
   </tr>
    <tr>
        <td colspan="2">
            QUẢN LÝ ẢNH QUẢNG CÁO
        </td>
    </tr>
    <tr>
        <td>
            Chọn khu vực đăng ảnh:
        </td>
        <td>
            <asp:DropDownList runat="server" ID="drdvitridanganh" 
                onselectedindexchanged="drdvitridanganh_SelectedIndexChanged" AutoPostBack="true"/>
        </td>
    </tr>
      <tr>
        <td>
            Link liên kết:
        </td>
        <td>
            <asp:TextBox runat="server" ID="txtlink" Width="500"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Chọn ảnh:
        </td>
        <td>
            <asp:FileUpload runat="server" ID="FileUpLoad1"/>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <asp:Image runat="server" ID="imgpreview" CssClass="displaypreview"/>
        </td>
    </tr>
    <tr>
        <td colspan="2">Thêm mới<asp:ImageButton runat="server" ID="imbtthem" 
                    AlternateText="Thêm mới" ImageUrl="images/tick_button.png" onclick="imbtthem_Click" 
                   />&nbsp;
            Xóa<asp:ImageButton ID="ImageButton2" runat="server" 
                ImageUrl="images/folder_closed_delete.png" onclick="ImageButton2_Click"/>
        </td>
    </tr>
   </table>
   <table class="table-format">
    <tr class="th">
        <th>Ảnh</th><th>Link Liên kết</th><th>Chọn xóa</th>
    </tr>
    <asp:Repeater runat="server" ID="rpt_anh">
        <ItemTemplate>
         <tr><td><asp:Label runat="server" ID="lblid" CssClass="hide" Text='<%#Eval("IdImage") %>'></asp:Label>
            <img src="../images/<%#Eval("Image") %>" style="max-width: 300px; max-height: 300px;" alt=""/>
         </td>
         <td>
            <%#Eval("link") %>
         </td>
            <td><asp:CheckBox runat="server" ID="chk"/></td></tr>
        </ItemTemplate>
          <ItemTemplate>
         <tr><td><asp:Label runat="server" ID="lblid" CssClass="hide" Text='<%#Eval("IdImage") %>'></asp:Label>
          <img src="../images/<%#Eval("Image") %>" style="max-width: 300px; max-height: 300px;" alt=""/>
         </td>
         <td>
            <%#Eval("link") %>
         </td>
            <td><asp:CheckBox runat="server" ID="chk"/></td></tr>
        </ItemTemplate>
    </asp:Repeater>
   
   </table>
</asp:Content>

